<template>
	<div>
		<div style="font-size:18px;">积分规则</div>
		<hr>
		<br>
		<el-table :data="list" border @selection-change="$handleSelectionChange">
			<el-table-column prop="real_name" label="姓名" min-width="100px"></el-table-column>
			<el-table-column prop="user_name" label="手机号" min-width="80px"></el-table-column>
			<el-table-column prop="score" label="积分" min-width="80px"></el-table-column>
		</el-table>
		<div class="pagination">
			<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :page-sizes="$page.selectPage" :page-size="$page.pageSize" layout="total, sizes, prev, pager, next, jumper" :total="$page.total">
			</el-pagination>
		</div>
	</div>
</template>
<script>
	export default {
		data() {
			return {
				list: [],
				urls: {
					getUserScore: "/UserScore/list",
				}
			};
		},
		mounted() {
			this.getPageData();
		},
		methods: {
			//改变分页后刷新
			getPageData(){
				this.getUserScore();
			},
			//获取用户积分
			getUserScore() {
				var that = this;
				this.myajax(this.urls.getUserScore,this.$page,function(res){
					var data = res.data;
					that.list=data.list;
					that.$page.total=data.total;
				})
			},
			handleCurrentChange(val) { //翻页
				this.$handleCurrentChange(val);
				this.getPageData();
			},
			handleSizeChange(val) { //每页数量
				this.$handleSizeChange(val);
				this.getPageData();
			},
			handleSelectionChange(val) {

			}
		}
	};
</script>
<style scoped>
	.input_edit {
		width: 200px;
		float: left;
		margin-right: 10px;
	}
	
	.cell {
		padding: 0 5px !important;
		overflow: auto;
	}
</style>